package com.fr.data.core.db.tableObject;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;

public abstract class AbstractModuleTables
  implements ModuleTables
{
  protected List tableObjectList = new ArrayList();
  protected List droptableList = new ArrayList();

  public void generatorModuleTables(Connection paramConnection)
  {
    initTableObjectList();
    int i = 0;
    int j = this.tableObjectList.size();
    while (i < j)
    {
      ((TableObject)this.tableObjectList.get(i)).createTable(paramConnection);
      ++i;
    }
  }

  protected abstract void initTableObjectList();

  public void removeModuleTables(Connection paramConnection)
  {
    if (this.droptableList.size() < 1)
    {
      initTableObjectList();
      this.droptableList = this.tableObjectList;
    }
    int i = 0;
    int j = this.droptableList.size();
    while (i < j)
    {
      ((TableObject)this.droptableList.get(i)).dropTable(paramConnection);
      ++i;
    }
  }
}